package com.xuxueli.applyModules.commont;//package com.xuxueli.commont;
//import ServiceGroupInfo;
//import Users;
//import lombok.extern.slf4j.Slf4j;
//import org.elasticsearch.client.RestHighLevelClient;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
//
///**
// * @CLassName ElasticSearchConfig
// * @Description TODO
// * @Version 1.0
// **/
//@Configuration
//@Slf4j
//public class ElasticSearchConfig {
//
//    @Bean
//    public ElasticsearchRestTemplate elasticsearchRestTemplate(RestHighLevelClient restHighLevelClient) {
//        ElasticsearchRestTemplate elasticsearchRestTemplate = new ElasticsearchRestTemplate(restHighLevelClient);
//        if (!elasticsearchRestTemplate.indexExists(Users.class)) {
//            elasticsearchRestTemplate.createIndex(Users.class);
//            elasticsearchRestTemplate.putMapping(Users.class);
//        }
//        if (!elasticsearchRestTemplate.indexExists(ServiceGroupInfo.class)) {
//            elasticsearchRestTemplate.createIndex(ServiceGroupInfo.class);
//            elasticsearchRestTemplate.putMapping(ServiceGroupInfo.class);
//        }
//
//        return elasticsearchRestTemplate;
//    }
//}